package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 设备维护计划表
 * @TableName device_maintenance_plan
 */
@TableName(value ="device_maintenance_plan")
@Data
public class DeviceMaintenancePlan implements Serializable {
    /**
     * 计划ID
     */
    @TableId(type = IdType.AUTO)
    private Long planId;

    /**
     * 设备ID
     */
    private Long deviceId;

    /**
     * 计划名称
     */
    private String planName;

    /**
     * 维护类型：1-日常，2-定期，3-故障
     */
    private Integer maintenanceType;

    /**
     * 计划日期
     */
    private Date planDate;

    /**
     * 维护人员
     */
    private String maintenancePerson;

    /**
     * 状态：1-待执行，2-执行中，3-已完成
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeviceMaintenancePlan other = (DeviceMaintenancePlan) that;
        return (this.getPlanId() == null ? other.getPlanId() == null : this.getPlanId().equals(other.getPlanId()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getPlanName() == null ? other.getPlanName() == null : this.getPlanName().equals(other.getPlanName()))
            && (this.getMaintenanceType() == null ? other.getMaintenanceType() == null : this.getMaintenanceType().equals(other.getMaintenanceType()))
            && (this.getPlanDate() == null ? other.getPlanDate() == null : this.getPlanDate().equals(other.getPlanDate()))
            && (this.getMaintenancePerson() == null ? other.getMaintenancePerson() == null : this.getMaintenancePerson().equals(other.getMaintenancePerson()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPlanId() == null) ? 0 : getPlanId().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getPlanName() == null) ? 0 : getPlanName().hashCode());
        result = prime * result + ((getMaintenanceType() == null) ? 0 : getMaintenanceType().hashCode());
        result = prime * result + ((getPlanDate() == null) ? 0 : getPlanDate().hashCode());
        result = prime * result + ((getMaintenancePerson() == null) ? 0 : getMaintenancePerson().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", planId=").append(planId);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", planName=").append(planName);
        sb.append(", maintenanceType=").append(maintenanceType);
        sb.append(", planDate=").append(planDate);
        sb.append(", maintenancePerson=").append(maintenancePerson);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}